Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid including null values in blocks list #41496

Merged
merged 1 commit into from
Jun 5, 2022
Merged

Avoid including null values in blocks list #41496

merged 1 commit into from
Jun 5, 2022

Conversation

msurdi
Copy link
Contributor

@msurdi msurdi commented Jun 2, 2022

What?

The problem reported in #41263 seems to be caused because of the inclusion of a null value in the list of blocks returned by getBlocks.

This small change will prevent having a null when the code is not running on a WP Context.

Why?

fixes #41263

How?

It avoids having null values in the list of blocks

Testing Instructions

  1. Run npm run storybook:dev
  2. Visit the Playground/Block editor/Default story
  3. Ensure you see the editor instead of an exception traceback.

Screenshots or screencast

Before:
image

After:
image

@msurdi msurdi requested a review from ajitbohra as a code owner June 2, 2022 09:16
@github-actions
Copy link

github-actions bot commented Jun 2, 2022

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @msurdi! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Jun 2, 2022
@Mamaduka Mamaduka added [Type] Regression Related to a regression in the latest release Storybook Storybook and its stories for components labels Jun 2, 2022
Copy link
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The conditional spread here makes sense to me. Thanks, @msurdi!

@msurdi
Copy link
Contributor Author

msurdi commented Jun 2, 2022

Thanks @Mamaduka . The End-to-End tests task seem to have failed, but I can't see how that's related to my change. Also, can't find (maybe due to permissions?) any knob to retry it to check if it was some sporadic error.

@msurdi
Copy link
Contributor Author

msurdi commented Jun 2, 2022

Oh, and by the way, I'm not able to merge this myself either, so let me know if there is anything else for me to do here to get this fixed.

@Mamaduka
Copy link
Member

Mamaduka commented Jun 2, 2022

@msurdi, restarted the test. Those seem flaky ones.

@Mamaduka Mamaduka merged commit 731cc90 into WordPress:trunk Jun 5, 2022
@github-actions
Copy link

github-actions bot commented Jun 5, 2022

Congratulations on your first merged pull request, @msurdi! We'd like to credit you for your contribution in the post announcing the next WordPress release, but we can't find a WordPress.org profile associated with your GitHub account. When you have a moment, visit the following URL and click "link your GitHub account" under "GitHub Username" to link your accounts:

https://profiles.wordpress.org/me/profile/edit/

And if you don't have a WordPress.org account, you can create one on this page:

https://login.wordpress.org/register

Kudos!

@github-actions github-actions bot added this to the Gutenberg 13.5 milestone Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository Storybook Storybook and its stories for components [Type] Regression Related to a regression in the latest release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Playground broken in storybook
2 participants